<div class="MemberMain">
<form id="f_order_pay" target="_blank" action="<{link app=b2c ctl='site_paycenter' act='dopayment' arg0='order'}>" method="post">
<input type="hidden" name="payment[order_id]" value="<{$order.order_id}>" />
<input type="hidden" name="payment[money]" value="<{$order.total_amount}>" id="hidden_money"/>
<input type="hidden" name="payment[currency]" value="<{$order.currency}>" />
<input type="hidden" name="payment[cur_money]" value="<{$order.cur_amount}>" id="hidden_cur_money"/>
<input type="hidden" name="payment[cur_rate]" value="<{$order.cur_rate}>" />
<input type="hidden" name="payment[cur_def]" value="<{$order.cur_def}>" />
<input type="hidden" name="payment[pay_app_id]" value="<{$order.payinfo.pay_app_id}>" />
<input type="hidden" name="payment[cost_payment]" value="<{$order.payinfo.cost_payment}>" />
<input type="hidden" name="payment[cur_amount]" value="<{$order.cur_amount}>" />
<input type="hidden" name="payment[memo]" value="<{$order.memo}>" />
<!--<input type="hidden" name="payment[return_url]" value="<{$return_url}>" />-->

<!--<div class="success clearfix pushdown-2">
   <h3><{t}>恭喜！您的订单已经提交！<{/t}></h3>
 
</div>-->

<h3><{t}>订单信息<{/t}></h3>
  <div class='ColColorBlue' style='padding:5px;border:1px #ccc solid;'>
      <span><{t}>订单编号：<{/t}></span><strong class='font14px'><{$order.order_id}></strong>&nbsp;&nbsp;[ <a href="<{link app=b2c ctl=site_member act=orderdetail arg0=$order.order_id}>" ><{t}>查看订单详细信息<{/t}>&raquo;</a> ]
  </div>
  <div class='division' style='padding:15px;'>
     <span><{t}>订单金额:<{/t}></span><strong class="hueorange fontcolorRed font20px" id="span_amount"><{$order.cur_amount|cur_odr:$order.currency:false:true}></strong>
  </div>

<h3><{t}>订单支付<{/t}></h3>
<{if $order.cur_amount > 0}>
<div class='ColColorBlue' style='padding:5px;border:1px #ccc solid;'>
  <{if !$order.selecttype}>
	<{t}>您选择了：<{/t}><strong class="hueorange fontcolorRed font14px"><{$order.payinfo.pay_app_id|pay_name}></strong>
	 <{if $order.payinfo.pay_app_id != '-1'}><a href='<{link app=b2c ctl="site_member" act="orderPayments" arg0=$order.order_id arg1='true'}>' ><{t}>[ 选择其他支付方式 ]<{/t}></a><{/if}>
  <{else}>
	 <{t}>请选择支付方式:<{/t}>
 <{/if}>
</div>
<div class='division' style="padding: 15px;">  
	<{if $order.selecttype}>
    <div class='select-paymethod'>
        <{if $payments}>
        <table width="100%" cellspacing="0" cellpadding="0" id="_normal_payment" class="liststyle data"> 
            <col class="span-5 ColColorGray">
            <col class="span-auto">
            <tbody>
            <{foreach from=$payments item=item key=key}>
                <tr>
                    <th style="text-align: left;">
                        <label><input type="radio" onclick="Order.paymentChange(this)" formatmoney="<{$order.cur_def}><{$item.cur_money}>" curmoney="<{$item.cur_money}>" moneyamount="<{$order.total_amount}>"<{if $order.payinfo.pay_app_id == $item.app_id}> checked="checked"<{/if}> value="<{$item.app_id}>" paytype="<{$item.app_id}>" name="payment[pay_app_id]" class="x-payMethod" style="cursor: pointer;"><{$item.app_name}></label> 
                    </th>
                    <td class="ColColorBlue selected"><{$item.app_des}></td>
                </tr>
            <{/foreach}>
            </tbody>
        </table>
        <{/if}>
    </div>
  
	<{else}>
		<input type="hidden" name="payment[pay_app_id]" value="<{$order.payinfo.pay_app_id}>" />
		<{if $extendInfo}>
		<div class='division paymethodextendInfo'>
			<{foreach from=$extendInfo item=item key=key}>
			<{if $item.type=='select'}>
				<select name=<{$key}>>
					<{foreach from=$item.value item=vitem key=vkey}>
						<option value="<{$vitem.value}>" <{if $vitem.checked}>selected<{/if}>><{$vitem.name}></option>
					<{/foreach}>
				</select>
			<{else}>
				<{foreach  from=$item.value item=vitem key=vkey}>
					<{if $item.type=='radio'}>
						<input <{$vitem.checked}> type='radio' name=<{$key}> value=<{$vitem.value}>><{if $vitem.imgname}><{$vitem.imgname}><{else}><{$vitem.name}><{/if}></if>
					<{else if $item.type=='checkbox'}>
						<input <{$vitem.checked}> type='checkbox' name="<{$key}>[]" value=<{$vitem.value}>><{if $vitem.imgname}><{$vitem.imgname}><{else}><{$vitem.name}><{/if}></if>
					<{/if}>
				<{/foreach}>
			<{/if}>
			<{/foreach}>
		</div>
		<{/if}>
	<{/if}> 
<{else}>
	<{t}>订单不需要再支付,请等待我们处理<{/t}>
<{/if}>
  
</div>

<{if $order.payinfo.pay_app_id != '-1'}>
<div class="textcenter" style="padding:10px;">
 <button type="submit" class="<{if $order.payinfo.pay_app_id!="offline"}>btn order-btn btn-has-icon<{else}>btn-pay-ok<{/if}>"><span><span><{if $order.payinfo.pay_app_id!="offline"}><{t}>立刻支付<{t}><{/if}><{if $order.payinfo.pay_app_id!="offline"}><i class="btn-icon"> <img src='<{$res_url}>/bundle/order.png'/></i><{/if}></span></span></button>
</div>
<{/if}>


</form>
</div>

<script>
        void function(){
        var form= $('f_order_pay');
            Order ={
                
                paymentChange:function(target){
                         if(!target)return;
                         target = $(target);
                     var money  = target.get('moneyamount');
                     var fmoney = target.get('formatmoney');
                     var paytype= target.get('paytype');
					 var cur_money = target.get('curmoney');
                     
                     $('hidden_money').set('value',money);
                     $('hidden_cur_money').set('value',cur_money);
                     $('span_amount').set('text',fmoney);
					 
					 var btn_odr = form.getElement('button[type=submit]');
					 
                     btn_odr.getElement('span span').innerHTML = paytype!='offline'?'<{t}>立刻支付<{t}><i class="btn-icon"> <img src="<{$res_url}>/bundle/order.png" /></i>':'';
                     
					 if (paytype!='offline'){
						btn_odr.set('class', 'btn order-btn btn-has-icon');
					 }else{
						btn_odr.set('class', 'btn-pay-ok');
					 }
                     //form.getElement('button[type=submit]')[(paytype=='offline'?'addClass':'removeClass')]('btn-pay-ok');
                     /* $$('#_normal_payment th .ExtendCon input[type=radio]').fireEvent('checkedchange');*/
                }
            
            };
            
            if($E('#f_order_pay .select-paymethod')){
                Order.paymentChange($E('#f_order_pay .select-paymethod input[checked]'));
                
                if(form&&form.getElement('button[type=submit]')){
                    form.getElement('button[type=submit]').addEvent('click',function(e){
                        
                        if(!$E('#f_order_pay .select-paymethod input[checked]')){
                        MessageBox.error('<{t}>请选择支付方式<{/t}>');
                        return e.stop();
                        }
                    
                    });
                }
            }
        }();
</script>
